﻿using System.Collections.Generic;

using SwyishChess.Domain.Move;
using SwyishChess.Domain.Piece;

namespace SwyishChess.Service
{
    public interface IMoveTrakingService
    {
        /// <summary>
        /// Records a chess move
        /// </summary>
        /// <param name="MoveTracker">List of chess moves</param>
        /// <param name="cp">Chess piece</param>
        /// <param name="currentRow">Current row location</param>
        /// <param name="currentColumn">Current column location</param>
        /// <param name="newRow">New row location</param>
        /// <param name="newColumn">new column location</param>
        /// <param name="capturedPiece">reference to a captured piece</param>
        void RecordMove(List<ChessMove> moveTracker, ChessPiece cp, int currentRow, int currentColumn, int newRow, int newColumn, ChessPiece capturedPiece);
        /// <summary>
        /// Overloaded RecordMove method which takes care of recording special moves
        /// </summary>
        /// <param name="MoveTracker">List of chess moves</param>
        /// <param name="cp">Chess piece</param>
        /// <param name="currentRow">Current row location</param>
        /// <param name="currentColumn">Current column location</param>
        /// <param name="newRow">New row location</param>
        /// <param name="newColumn">new column location</param>
        /// <param name="capturedPiece">reference to a captured piece</param>
        /// <param name="specialMove">SpecialMove type variable specifying which special move it was</param>
        void RecordMove(List<ChessMove> moveTracker, ChessPiece cp, int currentRow, int currentColumn, int newRow, int newColumn, ChessPiece capturedPiece, SpecialMove specialMove);
        /// <summary>
        /// <summary>
        /// Undo a move
        /// </summary>
        /// <param name="MoveTracker">List of chess moves</param>
        /// <param name="UndoedMoveTracker">List of undoed moves</param>
        /// <param name="ChessPieces">Chess pieces array</param>
        /// <param name="MoveID">Move id</param>
        void UndoMove(List<ChessMove> moveTracker, List<ChessMove> undoedMoveTracker, ChessPiece[,] chessPieces, int moveID);
        /// <summary>
        /// Redo a move
        /// </summary>
        /// <param name="MoveTracker">List of chess moves</param>
        /// <param name="UndoedMoveTracker">List of undoed moves</param>
        /// <param name="ChessPieces">Chess pieces array</param>
        /// <param name="MoveID">Move id</param>
        void RedoMove(List<ChessMove> moveTracker, List<ChessMove> undoedMoveTracker, ChessPiece[,] chessPieces, int moveID);
        /// <summary>
        /// Add captured piece to to the undo move tracker
        /// </summary>
        /// <param name="moveTracker">ChessMoves Array</param>
        /// <param name="capturedPiece">Captured piece reference</param>
        void AddCapturedPieceToListMove(List<ChessMove> moveTracker, ChessPiece capturedPiece);
        /// <summary>
        /// Add chess pieces affected by a special move to the undo move tracker
        /// </summary>
        /// <param name="moveTracker">ChessMoves array</param>
        /// <param name="affectedPiece">Affectred piece reference</param>
        void AddAffectedPieceToListMove(List<ChessMove> moveTracker, ChessPiece affectedPiece);
    }
}
